import request from "@/router/axios";

export const getRoleList = ( params) => {
  return request({
    url: "/api/project-manager/sys/roles/list",
    method: "get",
    params: { ...params },
  });
};



export const removeRoleItem = (ids) => {
  return request({
    url: "/api/project-manager/sys/roles/del",
    method: "delete",
    data: {
      role_ids: ids,
    },
  });
};

export const addRoleItem = (row) => {
  return request({
    url: "/api/project-manager/sys/roles/save",
    method: "post",
    data: row,
  });
};

export const updateRoleItem = (row) => {
  return request({
    url: "/api/project-manager/sys/roles/save",
    method: "post",
    data: row,
  });
};


// 获取角色菜单权限列表
export const getRolePermissionList = (role_id) => {
  return request({
    url: "/api/project-manager/sys/roles/permission",
    method: "get",
    params: role_id,
  });
};


// 获取角色菜单权限列表
export const getAllPermissionList = () => {
  return request({
    url: "/api/project-manager/sys/roles/all_permission",
    method: "get"
  });
};

// 更新角色权限接口
export const updateRoleItemPermission = (row) => {
  return request({
    url: "/api/project-manager/sys/roles/permission",
    method: "put",
    data: row,
  });
};
